#!/usr/bin/perl 

# configuration :
$logfile = "/usr/local/frogd/data/frogd.log";

# ne rien changer apres cette ligne
print "content-type: text/vnd.wap.wml\n\n";

print "
<?xml version=\"1.0\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml>
<card id=\"meteo\" title=\"meteo\">
<p>
<img src=\"frog.wbmp\" alt=\"grenouille\"/>
";
open(FILE, $logfile);
@lignes = <FILE>;
$last=$lignes[$#lignes];
chop($last);
@element = split(/:/, $last);

print "<table align=\"center\" columns=\"2\">";
print "<tr><td>temp</td><td><b>$element[2]&deg; C</b></td></tr>";
print "<tr><td>press</td><td><b>$element[3] hPa</b></td></tr>";
print "<tr><td>hum</td><td><b>$element[4]%</b></td></tr>";
print "</table>";
print "
</p>
</card>
</wml>
";
